package com.xbongbong.paas.form;

import com.xbongbong.paas.domain.entity.PaasFormExplainEntity;
import com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt;
import com.xbongbong.paas.domain.entity.ext.PaasFormEntityExt;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.toolbox.exception.XbbException;

import java.util.List;
import java.util.Map;

/** 基础表单接口
 *  提供表单相关接口
 * @author zheng.li
 */
public interface FormInterface {

    /**
     * 获取表单
     * @param corpid
     * @param formId
     * @param businessType
     * @return
     * @throws XbbException
     */
    PaasFormEntityExt getForm(String corpid, Long formId, Integer businessType) throws XbbException;


    /**
     * 获取表单解释
     * @param corpid 公司id
     * @param formId 模板id
     * @param businessType 业务类型
     * @return 表单解释
     * @throws XbbException 系统异常
     */
    PaasFormExplainEntity getFormExplain(String corpid, Long formId, Integer businessType) throws XbbException;

    /**
     * 获取表单数据
     * @param dataId 数据id
     * @param corpid 公司id
     * @param businessType 业务类型
     * @return PaasFormDataEntityExt
     */
    PaasFormDataEntityExt getFormData(Long dataId, String corpid, Integer businessType) throws XbbException;

    /**
     * 获取 表单字段解释映射
     * @param explainList 字段解释列表
     * @param businessType 业务类型
     * @param corpid 公司id
     * @param formId 表单id
     * @return 映射
     */
    Map<String, FieldAttrEntity> getExplainMap(List<FieldAttrEntity> explainList, Integer businessType, String corpid, Long formId);


}
